package com.example.shoppingmall.dao;


import com.example.shoppingmall.pojo.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface OrderMapper {
    //分页显示+条件查询所有数据
    public List<Order> getOrderList(@Param("orderId") Integer orderId,
                                    @Param("orderno") String orderno,@Param("date") String date,
                                    @Param("username") String username,@Param("phone") String phone,
                                    @Param("pageno") int pageno,@Param("pageSize") int pageSize);
    //查询总条数
    public int Count(@Param("orderId") Integer orderId,@Param("orderno") String orderno,
                     @Param("date") String date,
                     @Param("username") String username,@Param("phone") String phone);

    //查看详情
    public Order selxq(Integer id);

    //编辑订单信息（待发货）
    public int updOrder(Order order);

    //添加发货订单
    public int addinvoiceOrder(Invoice invoice);

    //修改订单状态--发货
    public int updorderstatus(@Param("id") Integer id);

    //查询发货数量--发货
    public OrderShop selalreadynum(@Param("id") Integer id);

    //修改商品表的已发数量--发货
    public int updordershopnum(@Param("already") Integer already,@Param("id") Integer id);
    
    //修改订单状态--完成
    public int updordersuccess(@Param("id") Integer id);

    //修改支付状态--支付
    public int updorderpay(@Param("paytype") Integer paytype,@Param("id") Integer id);

    //支付成功后新增支付信息流水列表
    public int addbillpayment(Bill_payment bill_payment);

    //根据订单id查询商品id
    public Order selordershopid(Integer id);

    //查询登陆用户的用户金额
    public User getusermoney(String userAccount);

    //修改登陆用户的用户金额
    public int updusermoney(User user);

}
